package com.atguigu.jxc.service.impl;

import com.atguigu.jxc.dao.DamageListDao;
import com.atguigu.jxc.dao.DamageListGoodsDao;
import com.atguigu.jxc.entity.DamageList;
import com.atguigu.jxc.entity.DamageListGoods;
import com.atguigu.jxc.service.DamageListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * TODO
 *
 * @author Mr.zhao
 * @version 1.0
 * @date 2022/1/4 11:25
 */
@Service
public class DamageListServiceImpl implements DamageListService {

    @Autowired
    private DamageListDao damageListDao;
    @Autowired
    private DamageListGoodsDao damageListGoodsDao;

    @Override
    public Map<String, Object> getList(String sTime, String eTime) {
        HashMap<String, Object> result = new HashMap<>();
        List<DamageList> list = damageListDao.getList(sTime,eTime);
        result.put("rows",list);


        return result;
    }

    @Override
    public Map<String, Object> getGoodsList(Integer damageListId) {
        HashMap<String, Object> result = new HashMap<>();
        List<DamageListGoods> list = damageListGoodsDao.getGoodsListById(damageListId);

        result.put("rows",list);

        return result;
    }
}
